Optimal. Leaf size=113 \[ -\frac{\log (x) (a+b x) (A b-a B)}{a^2 \sqrt{a^2+2 a b x+b^2 x^2}}+\frac{(a+b x) (A b-a B) \log (a+b x)}{a^2 \sqrt{a^2+2 a b x+b^2 x^2}}-\frac{A \sqrt{a^2+2 a b x+b^2 x^2}}{a^2 x} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0648089, antiderivative size = 113, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.172, Rules used = {769, 646, 36, 29, 31} \[ -\frac{\log (x) (a+b x) (A b-a B)}{a^2 \sqrt{a^2+2 a b x+b^2 x^2}}+\frac{(a+b x) (A b-a B) \log (a+b x)}{a^2 \sqrt{a^2+2 a b x+b^2 x^2}}-\frac{A \sqrt{a^2+2 a b x+b^2 x^2}}{a^2 x} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 769
Rule 646
Rule 36
Rule 29
Rule 31
Rubi steps
\begin{align*} \int \frac{A+B x}{x^2 \sqrt{a^2+2 a b x+b^2 x^2}} \, dx &=-\frac{A \sqrt{a^2+2 a b x+b^2 x^2}}{a^2 x}-\frac{\left (2 A b^2-2 a b B\right ) \int \frac{1}{x \sqrt{a^2+2 a b x+b^2 x^2}} \, dx}{2 a b}\\ &=-\frac{A \sqrt{a^2+2 a b x+b^2 x^2}}{a^2 x}-\frac{\left (\left (2 A b^2-2 a b B\right ) \left (a b+b^2 x\right )\right ) \int \frac{1}{x \left (a b+b^2 x\right )} \, dx}{2 a b \sqrt{a^2+2 a b x+b^2 x^2}}\\ &=-\frac{A \sqrt{a^2+2 a b x+b^2 x^2}}{a^2 x}+\frac{\left (\left (2 A b^2-2 a b B\right ) \left (a b+b^2 x\right )\right ) \int \frac{1}{a b+b^2 x} \, dx}{2 a^2 \sqrt{a^2+2 a b x+b^2 x^2}}-\frac{\left (\left (2 A b^2-2 a b B\right ) \left (a b+b^2 x\right )\right ) \int \frac{1}{x} \, dx}{2 a^2 b^2 \sqrt{a^2+2 a b x+b^2 x^2}}\\ &=-\frac{A \sqrt{a^2+2 a b x+b^2 x^2}}{a^2 x}-\frac{(A b-a B) (a+b x) \log (x)}{a^2 \sqrt{a^2+2 a b x+b^2 x^2}}+\frac{(A b-a B) (a+b x) \log (a+b x)}{a^2 \sqrt{a^2+2 a b x+b^2 x^2}}\\ \end{align*}
Mathematica [A] time = 0.0292133, size = 57, normalized size = 0.5 \[ \frac{(a+b x) (\log (x) (a B x-A b x)+x (A b-a B) \log (a+b x)-a A)}{a^2 x \sqrt{(a+b x)^2}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.013, size = 61, normalized size = 0.5 \begin{align*} -{\frac{ \left ( bx+a \right ) \left ( A\ln \left ( x \right ) xb-A\ln \left ( bx+a \right ) xb-B\ln \left ( x \right ) xa+B\ln \left ( bx+a \right ) xa+aA \right ) }{x{a}^{2}}{\frac{1}{\sqrt{ \left ( bx+a \right ) ^{2}}}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.64044, size = 92, normalized size = 0.81 \begin{align*} -\frac{{\left (B a - A b\right )} x \log \left (b x + a\right ) -{\left (B a - A b\right )} x \log \left (x\right ) + A a}{a^{2} x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.561037, size = 95, normalized size = 0.84 \begin{align*} - \frac{A}{a x} + \frac{\left (- A b + B a\right ) \log{\left (x + \frac{- A a b + B a^{2} - a \left (- A b + B a\right )}{- 2 A b^{2} + 2 B a b} \right )}}{a^{2}} - \frac{\left (- A b + B a\right ) \log{\left (x + \frac{- A a b + B a^{2} + a \left (- A b + B a\right )}{- 2 A b^{2} + 2 B a b} \right )}}{a^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.22742, size = 109, normalized size = 0.96 \begin{align*} \frac{{\left (B a \mathrm{sgn}\left (b x + a\right ) - A b \mathrm{sgn}\left (b x + a\right )\right )} \log \left ({\left | x \right |}\right )}{a^{2}} - \frac{A \mathrm{sgn}\left (b x + a\right )}{a x} - \frac{{\left (B a b \mathrm{sgn}\left (b x + a\right ) - A b^{2} \mathrm{sgn}\left (b x + a\right )\right )} \log \left ({\left | b x + a \right |}\right )}{a^{2} b} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]